﻿
USE [dbao_db]
GO
/****** Object:  Table [dbo].[LoaiPhim]    Script Date: 03/15/2012 00:25:14 ******/
DROP TABLE [dbo].[LoaiPhim]
GO
/****** Object:  Table [dbo].[MSTITEM]    Script Date: 03/15/2012 00:25:14 ******/
DROP TABLE [dbo].[MSTITEM]
GO
/****** Object:  Table [dbo].[MSTITEMNAME]    Script Date: 03/15/2012 00:25:14 ******/
DROP TABLE [dbo].[MSTITEMNAME]
GO
/****** Object:  Table [dbo].[PhanQuyen]    Script Date: 03/15/2012 00:25:13 ******/
DROP TABLE [dbo].[PhanQuyen]
GO
/****** Object:  Table [dbo].[Phim]    Script Date: 03/15/2012 00:25:13 ******/
DROP TABLE [dbo].[Phim]
GO
/****** Object:  Table [dbo].[TaiKhoan]    Script Date: 03/15/2012 00:25:13 ******/
DROP TABLE [dbo].[TaiKhoan]
GO
/****** Object:  Table [dbo].[TaiKhoan]    Script Date: 03/15/2012 00:25:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TaiKhoan](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nchar](20) NOT NULL,
	[Password] [nchar](20) NOT NULL,
	[MS_Quyen] [nchar](10) NOT NULL,
	[NgayDelete] [datetime] NULL,
	[NgayInsert] [datetime] NULL,
	[NguoiInsert] [nchar](10) NULL,
	[NgayUpdate] [datetime] NULL,
	[NguoiUpdate] [nchar](10) NULL,
 CONSTRAINT [PK_TaiKhoan] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[TaiKhoan] ON
INSERT [dbo].[TaiKhoan] ([ID], [UserName], [Password], [MS_Quyen], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (2, N'db                  ', N'123                 ', N'Q0001     ', NULL, NULL, NULL, NULL, NULL)
SET IDENTITY_INSERT [dbo].[TaiKhoan] OFF
/****** Object:  Table [dbo].[Phim]    Script Date: 03/15/2012 00:25:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Phim](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[MS_Phim] [nchar](10) NOT NULL,
	[Loai_Phim] [int] NOT NULL,
	[Tua_VN] [nvarchar](150) NOT NULL,
	[Tua_EN] [nvarchar](150) NOT NULL,
	[Dung_Luong] [int] NULL,
	[Hinh_Anh] [nchar](100) NULL,
	[Nam_SX] [int] NULL,
	[Quoc_Gia] [int] NULL,
	[Loai_HD] [int] NULL,
	[Phim_Chieu_Rap] [bit] NULL,
	[NgayDelete] [datetime] NULL,
	[NgayInsert] [datetime] NULL,
	[NguoiInsert] [nchar](10) NULL,
	[NgayUpdate] [datetime] NULL,
	[NguoiUpdate] [nchar](10) NULL,
 CONSTRAINT [PK_Phim] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Phim] ON
INSERT [dbo].[Phim] ([ID], [MS_Phim], [Loai_Phim], [Tua_VN], [Tua_EN], [Dung_Luong], [Hinh_Anh], [Nam_SX], [Quoc_Gia], [Loai_HD], [Phim_Chieu_Rap], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (1, N'PH00001   ', 3, N'231', N'213', 321, N'error                                                                                               ', 1, 1, 2, 1, NULL, CAST(0x0000A0140188D8D4 AS DateTime), N'db        ', CAST(0x0000A0140188D8D4 AS DateTime), N'db        ')
SET IDENTITY_INSERT [dbo].[Phim] OFF
/****** Object:  Table [dbo].[PhanQuyen]    Script Date: 03/15/2012 00:25:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PhanQuyen](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[MS_Quyen] [nchar](10) NOT NULL,
	[Loai_Quyen] [int] NOT NULL,
	[Mo_Ta] [nvarchar](150) NULL,
	[NgayDelete] [datetime] NULL,
	[NgayInsert] [datetime] NULL,
	[NguoiInsert] [nchar](10) NULL,
	[NgayUpdate] [datetime] NULL,
	[NguoiUpdate] [nchar](10) NULL,
 CONSTRAINT [PK_PhanQuyen] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_PhanQuyen] UNIQUE NONCLUSTERED 
(
	[MS_Quyen] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[PhanQuyen] ON
INSERT [dbo].[PhanQuyen] ([ID], [MS_Quyen], [Loai_Quyen], [Mo_Ta], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (1, N'Q0001     ', 1, N'admin', NULL, NULL, NULL, NULL, NULL)
SET IDENTITY_INSERT [dbo].[PhanQuyen] OFF
/****** Object:  Table [dbo].[MSTITEMNAME]    Script Date: 03/15/2012 00:25:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MSTITEMNAME](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Item_ID] [int] NULL,
	[Item_Value] [nvarchar](250) NULL,
	[Item_Name] [nvarchar](250) NULL,
	[NgayDelete] [datetime] NULL,
	[NgayInsert] [datetime] NULL,
	[NguoiInsert] [nchar](10) NULL,
	[NgayUpdate] [datetime] NULL,
	[NguoiUpdate] [nchar](10) NULL,
 CONSTRAINT [PK_MSTITEMNAME] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[MSTITEMNAME] ON
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (1, 1, N'1', N'HD720', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (2, 1, N'2', N'HD1024', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (3, 2, N'1', N'2012', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (4, 2, N'2', N'2011', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (5, 2, N'3', N'2010', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (6, 2, N'4', N'2009', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (7, 2, N'5', N'2008', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (8, 3, N'1', N'Mỹ - Châu Âu', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (9, 3, N'2', N'Hàn Quốc', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (10, 3, N'3', N'Nhật Bản', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (11, 3, N'4', N'Việt Nam', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (12, 3, N'5', N'Thái Lan', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (13, 3, N'6', N'Trung Quốc', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (14, 4, N'1', N'Hành Động - Xã Đội Đen', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (15, 4, N'2', N'Võ Thuật - Kiếm Hiệp', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (16, 4, N'3', N'Tâm Lý - Tình Cảm', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (17, 4, N'4', N'Hài Hước', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (18, 4, N'5', N'Kinh Dị - Ma', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (19, 4, N'6', N'Phiêu Lưu', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (20, 4, N'7', N'Thần Thoại', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (21, 4, N'8', N'Viễn Tưởng', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (22, 4, N'9', N'Hoạt Hình', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (23, 4, N'10', N'Chiến Tranh', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (24, 4, N'11', N'Thể Thao - Âm Nhạc', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (25, 4, N'12', N'Phim Việt Nam', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (26, 4, N'13', N'Phim Bộ Trung Quốc', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (27, 4, N'14', N'Phim Bộ Đài Loan', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (28, 4, N'15', N'Phim Bộ Hàn Quốc', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEMNAME] ([ID], [Item_ID], [Item_Value], [Item_Name], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (29, 3, N'6', N'Châu Á', NULL, NULL, NULL, NULL, NULL)
SET IDENTITY_INSERT [dbo].[MSTITEMNAME] OFF
/****** Object:  Table [dbo].[MSTITEM]    Script Date: 03/15/2012 00:25:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MSTITEM](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Ten_Item] [nchar](30) NOT NULL,
	[Mo_Ta] [nvarchar](150) NULL,
	[NgayDelete] [datetime] NULL,
	[NgayInsert] [datetime] NULL,
	[NguoiInsert] [nchar](10) NULL,
	[NgayUpdate] [datetime] NULL,
	[NguoiUpdate] [nchar](10) NULL,
 CONSTRAINT [PK_MSTITEM] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_MSTITEM] UNIQUE NONCLUSTERED 
(
	[Ten_Item] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[MSTITEM] ON
INSERT [dbo].[MSTITEM] ([ID], [Ten_Item], [Mo_Ta], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (1, N'LOAI_HD                       ', N'Loại HD', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEM] ([ID], [Ten_Item], [Mo_Ta], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (2, N'NAM_SX                        ', N'Năm sản xuất', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEM] ([ID], [Ten_Item], [Mo_Ta], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (3, N'QUOC_GIA                      ', N'Quốc gia sản xuất', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[MSTITEM] ([ID], [Ten_Item], [Mo_Ta], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (4, N'LOAI_PHIM                     ', N'Loại Phim', NULL, NULL, NULL, NULL, NULL)
SET IDENTITY_INSERT [dbo].[MSTITEM] OFF
/****** Object:  Table [dbo].[LoaiPhim]    Script Date: 03/15/2012 00:25:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[LoaiPhim](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[MS_Loai] [nchar](10) NOT NULL,
	[Ten_Loai] [nvarchar](150) NOT NULL,
	[Mo_Ta] [nvarchar](150) NULL,
	[NgayDelete] [datetime] NULL,
	[NgayInsert] [datetime] NULL,
	[NguoiInsert] [nchar](10) NULL,
	[NgayUpdate] [datetime] NULL,
	[NguoiUpdate] [nchar](10) NULL,
 CONSTRAINT [PK_LoaiPhim] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_LoaiPhim] UNIQUE NONCLUSTERED 
(
	[MS_Loai] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[LoaiPhim] ON
INSERT [dbo].[LoaiPhim] ([ID], [MS_Loai], [Ten_Loai], [Mo_Ta], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (13, N'LP00012   ', N'Phim Chiếu Rạp', N'Phim Chiếu Rạp', NULL, CAST(0x0000A00E00000000 AS DateTime), N'db        ', CAST(0x0000A00E00000000 AS DateTime), N'db        ')
INSERT [dbo].[LoaiPhim] ([ID], [MS_Loai], [Ten_Loai], [Mo_Ta], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (14, N'LP00013   ', N'Phim Lẻ', N'Phim Lẻ', NULL, CAST(0x0000A00E00000000 AS DateTime), N'db        ', CAST(0x0000A00E00000000 AS DateTime), N'db        ')
INSERT [dbo].[LoaiPhim] ([ID], [MS_Loai], [Ten_Loai], [Mo_Ta], [NgayDelete], [NgayInsert], [NguoiInsert], [NgayUpdate], [NguoiUpdate]) VALUES (15, N'LP00014   ', N'Phim Bộ', N'Phim Bộ', NULL, CAST(0x0000A00E00000000 AS DateTime), N'db        ', CAST(0x0000A00E00000000 AS DateTime), N'db        ')
SET IDENTITY_INSERT [dbo].[LoaiPhim] OFF
